3.10.14 \(\int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx\) [914]

3.10.14.1 Optimal result
3.10.14.2 Mathematica [A] (verified)
3.10.14.3 Rubi [A] (verified)
3.10.14.4 Maple [A] (verified)
3.10.14.5 Fricas [B] (verification not implemented)
3.10.14.6 Sympy [B] (verification not implemented)
3.10.14.7 Maxima [B] (verification not implemented)
3.10.14.8 Giac [B] (verification not implemented)
3.10.14.9 Mupad [B] (verification not implemented)

3.10.14.1 Optimal result

Integrand size = 31, antiderivative size = 139 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=-\frac {a^3 (c-d)^3 (c+d \sin (e+f x))^{1+n}}{d^4 f (1+n)}+\frac {3 a^3 (c-d)^2 (c+d \sin (e+f x))^{2+n}}{d^4 f (2+n)}-\frac {3 a^3 (c-d) (c+d \sin (e+f x))^{3+n}}{d^4 f (3+n)}+\frac {a^3 (c+d \sin (e+f x))^{4+n}}{d^4 f (4+n)} \]

output
-a^3*(c-d)^3*(c+d*sin(f*x+e))^(1+n)/d^4/f/(1+n)+3*a^3*(c-d)^2*(c+d*sin(f*x 
+e))^(2+n)/d^4/f/(2+n)-3*a^3*(c-d)*(c+d*sin(f*x+e))^(3+n)/d^4/f/(3+n)+a^3* 
(c+d*sin(f*x+e))^(4+n)/d^4/f/(4+n)
 
3.10.14.2 Mathematica [A] (verified)

Time = 0.23 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.76 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=\frac {a^3 (c+d \sin (e+f x))^{1+n} \left (-\frac {(c-d)^3}{1+n}+\frac {3 (c-d)^2 (c+d \sin (e+f x))}{2+n}-\frac {3 (c-d) (c+d \sin (e+f x))^2}{3+n}+\frac {(c+d \sin (e+f x))^3}{4+n}\right )}{d^4 f} \]

input
Integrate[Cos[e + f*x]*(a + a*Sin[e + f*x])^3*(c + d*Sin[e + f*x])^n,x]
 
output
(a^3*(c + d*Sin[e + f*x])^(1 + n)*(-((c - d)^3/(1 + n)) + (3*(c - d)^2*(c 
+ d*Sin[e + f*x]))/(2 + n) - (3*(c - d)*(c + d*Sin[e + f*x])^2)/(3 + n) + 
(c + d*Sin[e + f*x])^3/(4 + n)))/(d^4*f)
 
3.10.14.3 Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.96, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3042, 3312, 53, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cos (e+f x) (a \sin (e+f x)+a)^3 (c+d \sin (e+f x))^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \cos (e+f x) (a \sin (e+f x)+a)^3 (c+d \sin (e+f x))^ndx\)

\(\Big \downarrow \) 3312

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^3 (c+d \sin (e+f x))^nd(a \sin (e+f x))}{a f}\)

\(\Big \downarrow \) 53

\(\displaystyle \frac {\int \left (-\frac {a^3 (c-d)^3 (c+d \sin (e+f x))^n}{d^3}+\frac {3 a^3 (c-d)^2 (c+d \sin (e+f x))^{n+1}}{d^3}-\frac {3 a^3 (c-d) (c+d \sin (e+f x))^{n+2}}{d^3}+\frac {a^3 (c+d \sin (e+f x))^{n+3}}{d^3}\right )d(a \sin (e+f x))}{a f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {a^4 (c-d)^3 (c+d \sin (e+f x))^{n+1}}{d^4 (n+1)}+\frac {3 a^4 (c-d)^2 (c+d \sin (e+f x))^{n+2}}{d^4 (n+2)}-\frac {3 a^4 (c-d) (c+d \sin (e+f x))^{n+3}}{d^4 (n+3)}+\frac {a^4 (c+d \sin (e+f x))^{n+4}}{d^4 (n+4)}}{a f}\)

input
Int[Cos[e + f*x]*(a + a*Sin[e + f*x])^3*(c + d*Sin[e + f*x])^n,x]
 
output
(-((a^4*(c - d)^3*(c + d*Sin[e + f*x])^(1 + n))/(d^4*(1 + n))) + (3*a^4*(c 
 - d)^2*(c + d*Sin[e + f*x])^(2 + n))/(d^4*(2 + n)) - (3*a^4*(c - d)*(c + 
d*Sin[e + f*x])^(3 + n))/(d^4*(3 + n)) + (a^4*(c + d*Sin[e + f*x])^(4 + n) 
)/(d^4*(4 + n)))/(a*f)
 

3.10.14.3.1 Defintions of rubi rules used

rule 53
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int 
[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, 
x] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0] && LeQ[7*m + 4*n + 4, 0]) 
|| LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3312
Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*(( 
c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b*f)   Su 
bst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, 
b, c, d, e, f, m, n}, x]
 
3.10.14.4 Maple [A] (verified)

Time = 5.30 (sec) , antiderivative size = 262, normalized size of antiderivative = 1.88

method result size
parallelrisch \(\frac {6 \left (\frac {\left (\left (-\frac {4}{3} n^{2}-\frac {26}{3} n -14\right ) d^{2}-c n \left (4+n \right ) d +c^{2} n \right ) \left (1+n \right ) d^{2} \cos \left (2 f x +2 e \right )}{4}-\frac {\left (\left (3 n +12\right ) d +c n \right ) \left (1+n \right ) \left (2+n \right ) d^{3} \sin \left (3 f x +3 e \right )}{24}+\frac {d^{4} \left (3+n \right ) \left (2+n \right ) \left (1+n \right ) \cos \left (4 f x +4 e \right )}{48}+d \left (\left (7+\frac {115}{12} n +\frac {33}{8} n^{2}+\frac {13}{24} n^{3}\right ) d^{3}+\frac {5 c \left (n^{2}+\frac {31}{5} n +10\right ) n \,d^{2}}{8}-c^{2} n \left (4+n \right ) d +c^{3} n \right ) \sin \left (f x +e \right )+\frac {5 \left (1+n \right ) \left (3+n \right ) \left (n +\frac {18}{5}\right ) d^{4}}{16}+\frac {5 c \left (4+n \right ) \left (n^{2}+\frac {13}{5} n +\frac {12}{5}\right ) d^{3}}{12}-\frac {3 c^{2} \left (n^{2}+5 n +8\right ) d^{2}}{4}+c^{3} \left (4+n \right ) d -c^{4}\right ) \left (c +d \sin \left (f x +e \right )\right )^{n} a^{3}}{\left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right ) d^{4} f}\) \(262\)
derivativedivides \(\frac {a^{3} \left (\sin ^{4}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f \left (4+n \right )}+\frac {a^{3} \left (3 c \,d^{2} n^{3}+d^{3} n^{3}-6 c^{2} d \,n^{2}+21 c \,d^{2} n^{2}+9 d^{3} n^{2}+6 c^{3} n -24 c^{2} d n +36 c \,d^{2} n +26 d^{3} n +24 d^{3}\right ) \sin \left (f x +e \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{3} \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right ) f}+\frac {\left (c n +3 n d +12 d \right ) a^{3} \left (\sin ^{3}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d f \left (n^{2}+7 n +12\right )}-\frac {a^{3} c \left (-d^{3} n^{3}+3 c \,d^{2} n^{2}-9 d^{3} n^{2}-6 c^{2} d n +21 c \,d^{2} n -26 d^{3} n +6 c^{3}-24 c^{2} d +36 d^{2} c -24 d^{3}\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{4} f \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right )}-\frac {3 \left (-c d \,n^{2}-d^{2} n^{2}+c^{2} n -4 c d n -7 d^{2} n -12 d^{2}\right ) a^{3} \left (\sin ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{2} f \left (n^{3}+9 n^{2}+26 n +24\right )}\) \(412\)
default \(\frac {a^{3} \left (\sin ^{4}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{f \left (4+n \right )}+\frac {a^{3} \left (3 c \,d^{2} n^{3}+d^{3} n^{3}-6 c^{2} d \,n^{2}+21 c \,d^{2} n^{2}+9 d^{3} n^{2}+6 c^{3} n -24 c^{2} d n +36 c \,d^{2} n +26 d^{3} n +24 d^{3}\right ) \sin \left (f x +e \right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{3} \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right ) f}+\frac {\left (c n +3 n d +12 d \right ) a^{3} \left (\sin ^{3}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d f \left (n^{2}+7 n +12\right )}-\frac {a^{3} c \left (-d^{3} n^{3}+3 c \,d^{2} n^{2}-9 d^{3} n^{2}-6 c^{2} d n +21 c \,d^{2} n -26 d^{3} n +6 c^{3}-24 c^{2} d +36 d^{2} c -24 d^{3}\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{4} f \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right )}-\frac {3 \left (-c d \,n^{2}-d^{2} n^{2}+c^{2} n -4 c d n -7 d^{2} n -12 d^{2}\right ) a^{3} \left (\sin ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c +d \sin \left (f x +e \right )\right )}}{d^{2} f \left (n^{3}+9 n^{2}+26 n +24\right )}\) \(412\)

input
int(cos(f*x+e)*(a+a*sin(f*x+e))^3*(c+d*sin(f*x+e))^n,x,method=_RETURNVERBO 
SE)
 
output
6*(1/4*((-4/3*n^2-26/3*n-14)*d^2-c*n*(4+n)*d+c^2*n)*(1+n)*d^2*cos(2*f*x+2* 
e)-1/24*((3*n+12)*d+c*n)*(1+n)*(2+n)*d^3*sin(3*f*x+3*e)+1/48*d^4*(3+n)*(2+ 
n)*(1+n)*cos(4*f*x+4*e)+d*((7+115/12*n+33/8*n^2+13/24*n^3)*d^3+5/8*c*(n^2+ 
31/5*n+10)*n*d^2-c^2*n*(4+n)*d+c^3*n)*sin(f*x+e)+5/16*(1+n)*(3+n)*(n+18/5) 
*d^4+5/12*c*(4+n)*(n^2+13/5*n+12/5)*d^3-3/4*c^2*(n^2+5*n+8)*d^2+c^3*(4+n)* 
d-c^4)*(c+d*sin(f*x+e))^n*a^3/(n^4+10*n^3+35*n^2+50*n+24)/d^4/f
 
3.10.14.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 545 vs. \(2 (139) = 278\).

Time = 0.34 (sec) , antiderivative size = 545, normalized size of antiderivative = 3.92 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=-\frac {{\left (6 \, a^{3} c^{4} - 24 \, a^{3} c^{3} d + 36 \, a^{3} c^{2} d^{2} - 24 \, a^{3} c d^{3} - 42 \, a^{3} d^{4} - {\left (a^{3} d^{4} n^{3} + 6 \, a^{3} d^{4} n^{2} + 11 \, a^{3} d^{4} n + 6 \, a^{3} d^{4}\right )} \cos \left (f x + e\right )^{4} - 4 \, {\left (a^{3} c d^{3} + a^{3} d^{4}\right )} n^{3} + 6 \, {\left (a^{3} c^{2} d^{2} - 4 \, a^{3} c d^{3} - 5 \, a^{3} d^{4}\right )} n^{2} + {\left (48 \, a^{3} d^{4} + {\left (3 \, a^{3} c d^{3} + 5 \, a^{3} d^{4}\right )} n^{3} - 3 \, {\left (a^{3} c^{2} d^{2} - 5 \, a^{3} c d^{3} - 12 \, a^{3} d^{4}\right )} n^{2} - {\left (3 \, a^{3} c^{2} d^{2} - 12 \, a^{3} c d^{3} - 79 \, a^{3} d^{4}\right )} n\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (3 \, a^{3} c^{3} d - 12 \, a^{3} c^{2} d^{2} + 19 \, a^{3} c d^{3} + 34 \, a^{3} d^{4}\right )} n - {\left (48 \, a^{3} d^{4} + 4 \, {\left (a^{3} c d^{3} + a^{3} d^{4}\right )} n^{3} - 6 \, {\left (a^{3} c^{2} d^{2} - 4 \, a^{3} c d^{3} - 5 \, a^{3} d^{4}\right )} n^{2} - {\left (24 \, a^{3} d^{4} + {\left (a^{3} c d^{3} + 3 \, a^{3} d^{4}\right )} n^{3} + 3 \, {\left (a^{3} c d^{3} + 7 \, a^{3} d^{4}\right )} n^{2} + 2 \, {\left (a^{3} c d^{3} + 21 \, a^{3} d^{4}\right )} n\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (3 \, a^{3} c^{3} d - 12 \, a^{3} c^{2} d^{2} + 19 \, a^{3} c d^{3} + 34 \, a^{3} d^{4}\right )} n\right )} \sin \left (f x + e\right )\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n}}{d^{4} f n^{4} + 10 \, d^{4} f n^{3} + 35 \, d^{4} f n^{2} + 50 \, d^{4} f n + 24 \, d^{4} f} \]

input
integrate(cos(f*x+e)*(a+a*sin(f*x+e))^3*(c+d*sin(f*x+e))^n,x, algorithm="f 
ricas")
 
output
-(6*a^3*c^4 - 24*a^3*c^3*d + 36*a^3*c^2*d^2 - 24*a^3*c*d^3 - 42*a^3*d^4 - 
(a^3*d^4*n^3 + 6*a^3*d^4*n^2 + 11*a^3*d^4*n + 6*a^3*d^4)*cos(f*x + e)^4 - 
4*(a^3*c*d^3 + a^3*d^4)*n^3 + 6*(a^3*c^2*d^2 - 4*a^3*c*d^3 - 5*a^3*d^4)*n^ 
2 + (48*a^3*d^4 + (3*a^3*c*d^3 + 5*a^3*d^4)*n^3 - 3*(a^3*c^2*d^2 - 5*a^3*c 
*d^3 - 12*a^3*d^4)*n^2 - (3*a^3*c^2*d^2 - 12*a^3*c*d^3 - 79*a^3*d^4)*n)*co 
s(f*x + e)^2 - 2*(3*a^3*c^3*d - 12*a^3*c^2*d^2 + 19*a^3*c*d^3 + 34*a^3*d^4 
)*n - (48*a^3*d^4 + 4*(a^3*c*d^3 + a^3*d^4)*n^3 - 6*(a^3*c^2*d^2 - 4*a^3*c 
*d^3 - 5*a^3*d^4)*n^2 - (24*a^3*d^4 + (a^3*c*d^3 + 3*a^3*d^4)*n^3 + 3*(a^3 
*c*d^3 + 7*a^3*d^4)*n^2 + 2*(a^3*c*d^3 + 21*a^3*d^4)*n)*cos(f*x + e)^2 + 2 
*(3*a^3*c^3*d - 12*a^3*c^2*d^2 + 19*a^3*c*d^3 + 34*a^3*d^4)*n)*sin(f*x + e 
))*(d*sin(f*x + e) + c)^n/(d^4*f*n^4 + 10*d^4*f*n^3 + 35*d^4*f*n^2 + 50*d^ 
4*f*n + 24*d^4*f)
 
3.10.14.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 5596 vs. \(2 (117) = 234\).

Time = 8.48 (sec) , antiderivative size = 5596, normalized size of antiderivative = 40.26 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=\text {Too large to display} \]

input
integrate(cos(f*x+e)*(a+a*sin(f*x+e))**3*(c+d*sin(f*x+e))**n,x)
 
output
Piecewise((c**n*(a**3*sin(e + f*x)**4/(4*f) + a**3*sin(e + f*x)**3/f + 3*a 
**3*sin(e + f*x)**2/(2*f) + a**3*sin(e + f*x)/f), Eq(d, 0)), (x*(c + d*sin 
(e))**n*(a*sin(e) + a)**3*cos(e), Eq(f, 0)), (6*a**3*c**3*log(c/d + sin(e 
+ f*x))/(6*c**3*d**4*f + 18*c**2*d**5*f*sin(e + f*x) + 18*c*d**6*f*sin(e + 
 f*x)**2 + 6*d**7*f*sin(e + f*x)**3) + 11*a**3*c**3/(6*c**3*d**4*f + 18*c* 
*2*d**5*f*sin(e + f*x) + 18*c*d**6*f*sin(e + f*x)**2 + 6*d**7*f*sin(e + f* 
x)**3) + 18*a**3*c**2*d*log(c/d + sin(e + f*x))*sin(e + f*x)/(6*c**3*d**4* 
f + 18*c**2*d**5*f*sin(e + f*x) + 18*c*d**6*f*sin(e + f*x)**2 + 6*d**7*f*s 
in(e + f*x)**3) + 27*a**3*c**2*d*sin(e + f*x)/(6*c**3*d**4*f + 18*c**2*d** 
5*f*sin(e + f*x) + 18*c*d**6*f*sin(e + f*x)**2 + 6*d**7*f*sin(e + f*x)**3) 
 - 6*a**3*c**2*d/(6*c**3*d**4*f + 18*c**2*d**5*f*sin(e + f*x) + 18*c*d**6* 
f*sin(e + f*x)**2 + 6*d**7*f*sin(e + f*x)**3) + 18*a**3*c*d**2*log(c/d + s 
in(e + f*x))*sin(e + f*x)**2/(6*c**3*d**4*f + 18*c**2*d**5*f*sin(e + f*x) 
+ 18*c*d**6*f*sin(e + f*x)**2 + 6*d**7*f*sin(e + f*x)**3) + 18*a**3*c*d**2 
*sin(e + f*x)**2/(6*c**3*d**4*f + 18*c**2*d**5*f*sin(e + f*x) + 18*c*d**6* 
f*sin(e + f*x)**2 + 6*d**7*f*sin(e + f*x)**3) - 18*a**3*c*d**2*sin(e + f*x 
)/(6*c**3*d**4*f + 18*c**2*d**5*f*sin(e + f*x) + 18*c*d**6*f*sin(e + f*x)* 
*2 + 6*d**7*f*sin(e + f*x)**3) - 3*a**3*c*d**2/(6*c**3*d**4*f + 18*c**2*d* 
*5*f*sin(e + f*x) + 18*c*d**6*f*sin(e + f*x)**2 + 6*d**7*f*sin(e + f*x)**3 
) + 6*a**3*d**3*log(c/d + sin(e + f*x))*sin(e + f*x)**3/(6*c**3*d**4*f ...
 
3.10.14.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 313 vs. \(2 (139) = 278\).

Time = 0.22 (sec) , antiderivative size = 313, normalized size of antiderivative = 2.25 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=\frac {\frac {3 \, {\left (d^{2} {\left (n + 1\right )} \sin \left (f x + e\right )^{2} + c d n \sin \left (f x + e\right ) - c^{2}\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} a^{3}}{{\left (n^{2} + 3 \, n + 2\right )} d^{2}} + \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{n + 1} a^{3}}{d {\left (n + 1\right )}} + \frac {3 \, {\left ({\left (n^{2} + 3 \, n + 2\right )} d^{3} \sin \left (f x + e\right )^{3} + {\left (n^{2} + n\right )} c d^{2} \sin \left (f x + e\right )^{2} - 2 \, c^{2} d n \sin \left (f x + e\right ) + 2 \, c^{3}\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} a^{3}}{{\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} d^{3}} + \frac {{\left ({\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} d^{4} \sin \left (f x + e\right )^{4} + {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} c d^{3} \sin \left (f x + e\right )^{3} - 3 \, {\left (n^{2} + n\right )} c^{2} d^{2} \sin \left (f x + e\right )^{2} + 6 \, c^{3} d n \sin \left (f x + e\right ) - 6 \, c^{4}\right )} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} a^{3}}{{\left (n^{4} + 10 \, n^{3} + 35 \, n^{2} + 50 \, n + 24\right )} d^{4}}}{f} \]

input
integrate(cos(f*x+e)*(a+a*sin(f*x+e))^3*(c+d*sin(f*x+e))^n,x, algorithm="m 
axima")
 
output
(3*(d^2*(n + 1)*sin(f*x + e)^2 + c*d*n*sin(f*x + e) - c^2)*(d*sin(f*x + e) 
 + c)^n*a^3/((n^2 + 3*n + 2)*d^2) + (d*sin(f*x + e) + c)^(n + 1)*a^3/(d*(n 
 + 1)) + 3*((n^2 + 3*n + 2)*d^3*sin(f*x + e)^3 + (n^2 + n)*c*d^2*sin(f*x + 
 e)^2 - 2*c^2*d*n*sin(f*x + e) + 2*c^3)*(d*sin(f*x + e) + c)^n*a^3/((n^3 + 
 6*n^2 + 11*n + 6)*d^3) + ((n^3 + 6*n^2 + 11*n + 6)*d^4*sin(f*x + e)^4 + ( 
n^3 + 3*n^2 + 2*n)*c*d^3*sin(f*x + e)^3 - 3*(n^2 + n)*c^2*d^2*sin(f*x + e) 
^2 + 6*c^3*d*n*sin(f*x + e) - 6*c^4)*(d*sin(f*x + e) + c)^n*a^3/((n^4 + 10 
*n^3 + 35*n^2 + 50*n + 24)*d^4))/f
 
3.10.14.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 942 vs. \(2 (139) = 278\).

Time = 0.36 (sec) , antiderivative size = 942, normalized size of antiderivative = 6.78 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=\text {Too large to display} \]

input
integrate(cos(f*x+e)*(a+a*sin(f*x+e))^3*(c+d*sin(f*x+e))^n,x, algorithm="g 
iac")
 
output
(((d*sin(f*x + e) + c)^4*(d*sin(f*x + e) + c)^n*n^3 - 3*(d*sin(f*x + e) + 
c)^3*(d*sin(f*x + e) + c)^n*c*n^3 + 3*(d*sin(f*x + e) + c)^2*(d*sin(f*x + 
e) + c)^n*c^2*n^3 - (d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^3*n^3 + 
6*(d*sin(f*x + e) + c)^4*(d*sin(f*x + e) + c)^n*n^2 - 21*(d*sin(f*x + e) + 
 c)^3*(d*sin(f*x + e) + c)^n*c*n^2 + 24*(d*sin(f*x + e) + c)^2*(d*sin(f*x 
+ e) + c)^n*c^2*n^2 - 9*(d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^3*n^ 
2 + 11*(d*sin(f*x + e) + c)^4*(d*sin(f*x + e) + c)^n*n - 42*(d*sin(f*x + e 
) + c)^3*(d*sin(f*x + e) + c)^n*c*n + 57*(d*sin(f*x + e) + c)^2*(d*sin(f*x 
 + e) + c)^n*c^2*n - 26*(d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^3*n 
+ 6*(d*sin(f*x + e) + c)^4*(d*sin(f*x + e) + c)^n - 24*(d*sin(f*x + e) + c 
)^3*(d*sin(f*x + e) + c)^n*c + 36*(d*sin(f*x + e) + c)^2*(d*sin(f*x + e) + 
 c)^n*c^2 - 24*(d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^3)*a^3/(d^3*n 
^4 + 10*d^3*n^3 + 35*d^3*n^2 + 50*d^3*n + 24*d^3) + 3*((d*sin(f*x + e) + c 
)^3*(d*sin(f*x + e) + c)^n*n^2 - 2*(d*sin(f*x + e) + c)^2*(d*sin(f*x + e) 
+ c)^n*c*n^2 + (d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c^2*n^2 + 3*(d* 
sin(f*x + e) + c)^3*(d*sin(f*x + e) + c)^n*n - 8*(d*sin(f*x + e) + c)^2*(d 
*sin(f*x + e) + c)^n*c*n + 5*(d*sin(f*x + e) + c)*(d*sin(f*x + e) + c)^n*c 
^2*n + 2*(d*sin(f*x + e) + c)^3*(d*sin(f*x + e) + c)^n - 6*(d*sin(f*x + e) 
 + c)^2*(d*sin(f*x + e) + c)^n*c + 6*(d*sin(f*x + e) + c)*(d*sin(f*x + e) 
+ c)^n*c^2)*a^3/(d^2*n^3 + 6*d^2*n^2 + 11*d^2*n + 6*d^2) + (d*sin(f*x +...
 
3.10.14.9 Mupad [B] (verification not implemented)

Time = 14.23 (sec) , antiderivative size = 617, normalized size of antiderivative = 4.44 \[ \int \cos (e+f x) (a+a \sin (e+f x))^3 (c+d \sin (e+f x))^n \, dx=\frac {a^3\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n\,\left (192\,c\,d^3+192\,c^3\,d+261\,d^4\,n+336\,d^4\,\sin \left (e+f\,x\right )-48\,c^4+162\,d^4-288\,c^2\,d^2-168\,d^4\,\cos \left (2\,e+2\,f\,x\right )+6\,d^4\,\cos \left (4\,e+4\,f\,x\right )+114\,d^4\,n^2+15\,d^4\,n^3-48\,d^4\,\sin \left (3\,e+3\,f\,x\right )+460\,d^4\,n\,\sin \left (e+f\,x\right )-180\,c^2\,d^2\,n+132\,c\,d^3\,n^2+20\,c\,d^3\,n^3-272\,d^4\,n\,\cos \left (2\,e+2\,f\,x\right )+11\,d^4\,n\,\cos \left (4\,e+4\,f\,x\right )-84\,d^4\,n\,\sin \left (3\,e+3\,f\,x\right )+198\,d^4\,n^2\,\sin \left (e+f\,x\right )+26\,d^4\,n^3\,\sin \left (e+f\,x\right )-36\,c^2\,d^2\,n^2-120\,d^4\,n^2\,\cos \left (2\,e+2\,f\,x\right )-16\,d^4\,n^3\,\cos \left (2\,e+2\,f\,x\right )+6\,d^4\,n^2\,\cos \left (4\,e+4\,f\,x\right )+d^4\,n^3\,\cos \left (4\,e+4\,f\,x\right )-42\,d^4\,n^2\,\sin \left (3\,e+3\,f\,x\right )-6\,d^4\,n^3\,\sin \left (3\,e+3\,f\,x\right )+256\,c\,d^3\,n+48\,c^3\,d\,n+12\,c^2\,d^2\,n\,\cos \left (2\,e+2\,f\,x\right )-60\,c\,d^3\,n^2\,\cos \left (2\,e+2\,f\,x\right )-12\,c\,d^3\,n^3\,\cos \left (2\,e+2\,f\,x\right )-6\,c\,d^3\,n^2\,\sin \left (3\,e+3\,f\,x\right )-2\,c\,d^3\,n^3\,\sin \left (3\,e+3\,f\,x\right )-48\,c^2\,d^2\,n^2\,\sin \left (e+f\,x\right )+300\,c\,d^3\,n\,\sin \left (e+f\,x\right )+48\,c^3\,d\,n\,\sin \left (e+f\,x\right )+12\,c^2\,d^2\,n^2\,\cos \left (2\,e+2\,f\,x\right )-48\,c\,d^3\,n\,\cos \left (2\,e+2\,f\,x\right )-4\,c\,d^3\,n\,\sin \left (3\,e+3\,f\,x\right )-192\,c^2\,d^2\,n\,\sin \left (e+f\,x\right )+186\,c\,d^3\,n^2\,\sin \left (e+f\,x\right )+30\,c\,d^3\,n^3\,\sin \left (e+f\,x\right )\right )}{8\,d^4\,f\,\left (n^4+10\,n^3+35\,n^2+50\,n+24\right )} \]

input
int(cos(e + f*x)*(a + a*sin(e + f*x))^3*(c + d*sin(e + f*x))^n,x)
 
output
(a^3*(c + d*sin(e + f*x))^n*(192*c*d^3 + 192*c^3*d + 261*d^4*n + 336*d^4*s 
in(e + f*x) - 48*c^4 + 162*d^4 - 288*c^2*d^2 - 168*d^4*cos(2*e + 2*f*x) + 
6*d^4*cos(4*e + 4*f*x) + 114*d^4*n^2 + 15*d^4*n^3 - 48*d^4*sin(3*e + 3*f*x 
) + 460*d^4*n*sin(e + f*x) - 180*c^2*d^2*n + 132*c*d^3*n^2 + 20*c*d^3*n^3 
- 272*d^4*n*cos(2*e + 2*f*x) + 11*d^4*n*cos(4*e + 4*f*x) - 84*d^4*n*sin(3* 
e + 3*f*x) + 198*d^4*n^2*sin(e + f*x) + 26*d^4*n^3*sin(e + f*x) - 36*c^2*d 
^2*n^2 - 120*d^4*n^2*cos(2*e + 2*f*x) - 16*d^4*n^3*cos(2*e + 2*f*x) + 6*d^ 
4*n^2*cos(4*e + 4*f*x) + d^4*n^3*cos(4*e + 4*f*x) - 42*d^4*n^2*sin(3*e + 3 
*f*x) - 6*d^4*n^3*sin(3*e + 3*f*x) + 256*c*d^3*n + 48*c^3*d*n + 12*c^2*d^2 
*n*cos(2*e + 2*f*x) - 60*c*d^3*n^2*cos(2*e + 2*f*x) - 12*c*d^3*n^3*cos(2*e 
 + 2*f*x) - 6*c*d^3*n^2*sin(3*e + 3*f*x) - 2*c*d^3*n^3*sin(3*e + 3*f*x) - 
48*c^2*d^2*n^2*sin(e + f*x) + 300*c*d^3*n*sin(e + f*x) + 48*c^3*d*n*sin(e 
+ f*x) + 12*c^2*d^2*n^2*cos(2*e + 2*f*x) - 48*c*d^3*n*cos(2*e + 2*f*x) - 4 
*c*d^3*n*sin(3*e + 3*f*x) - 192*c^2*d^2*n*sin(e + f*x) + 186*c*d^3*n^2*sin 
(e + f*x) + 30*c*d^3*n^3*sin(e + f*x)))/(8*d^4*f*(50*n + 35*n^2 + 10*n^3 + 
 n^4 + 24))